<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var a = prompt("请输入号码");
        var reg = /^\d{3,5}-{1}\d{8}$/;
        var reg1 = new RegExp("^\d{3,5}-{1}\d{8}$","g");
        if(reg1.test(a) == true){
            alert("是本地号码");
        }else{
            alert("不是本地号");
        }
  </script>
</body>
</html>